package com.Trainer.TrainerInterface;

import javax.swing.*;
import java.awt.*;

public class TrainerBottomRightPanel extends JPanel{
    //属性
    JButton plusBtn;
    JButton subBtn;
    JButton plusSubBtn;
    JButton backBtn;

    //构造器
    public TrainerBottomRightPanel(int x,int y,int weight,int height){
        plusBtn = new JButton("加法");
        subBtn = new JButton("减法");
        plusSubBtn = new JButton("加减法");
        backBtn = new JButton("返回");


        //布局
        setLayout(null);
        setBounds(x,y,weight,height);
        //setBackground(Color.GREEN);

        //按钮修饰
        setButton(plusBtn,10,10,200,90);
        setButton(subBtn,10,105,200,90);
        setButton(plusSubBtn,10,205,200,90);
        setButton(backBtn,10,305,200,90);
        //添加按钮
        add(plusBtn);
        add(subBtn);
        add(plusSubBtn);
        add(backBtn);

    }
    //方法
    public void setButton(JButton btn,int x,int y,int weight,int height){
        btn.setBounds(x,y,weight,height);
        btn.setFont(new Font("微软雅黑",Font.PLAIN,25));
        btn.setHorizontalAlignment(SwingConstants.CENTER);
    }

    public JButton getPlusBtn() {
        return plusBtn;
    }

    public JButton getSubBtn() {
        return subBtn;
    }

    public JButton getPlusSubBtn() {
        return plusSubBtn;
    }

    public JButton getBackBtn() {
        return backBtn;
    }
}
